package xyz.jcat.biz.admin.domain.dto;

import lombok.Getter;
import lombok.Setter;
import xyz.jcat.webmvc.validator.EnumNum;
import xyz.jcat.webmvc.validator.Phone;

import javax.validation.constraints.Email;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;

@Getter
@Setter
public class UserAddDto {

    /** 登录用户名 */
    @NotBlank(message = "请填写用户名")
    @Size(min = 2, max = 30, message = "用户名长度为2~30")
    private String username;
    /** 邮箱 */
    @Email(message = "请填写正确的邮箱")
    private String email;
    /** 手机号 */
    @Phone
    @NotBlank(message = "请填写手机号")
    private String phone;
    /** 姓名 */
    @NotBlank(message = "请填写用户姓名")
    @Size(min = 2, max = 5, message = "用户姓名长度为2~5")
    private String name;
    /** 性别 */
    @EnumNum(values = {0,1})
    private Integer gender;

}
